*** Sexism and Voting for Women Candidates - BJPS replication do-files
*** Britain

log using "C:\Users\a15014rs\Dropbox\Sexism and Candidates\Analysis\BJPS replication files\Britain_log_file.log", replace

** Recode 2017 results to calculate distance from winner in previous election

cd "C:\Users\a15014rs\Dropbox\Sexism and Candidates\Data\"

import delimited "HoC-GE2017-constituency-results.csv", clear

keep constituency_name valid_votes first_party con lab ld ukip green snp pc

** drop N Ireland
drop if constituency_name=="Belfast East"|constituency_name=="Belfast North"|constituency_name=="Belfast South"| ///
	constituency_name=="East Antrim"|constituency_name=="East Londonderry"|constituency_name=="Fermanagh and South Tyrone"| ///
	constituency_name=="Lagan Valley"|constituency_name=="North Down"|constituency_name=="Strangford"|constituency_name=="West Tyrone"
	
rename con votes1
rename lab votes2 
rename ld votes3 
rename ukip votes4
rename green votes5
rename snp votes6
rename pc votes7

** Names to match 2019 data
** UKIP 2017 = Brexit 2019
reshape long votes, i(constituency_name) j(party)
gen party_name="Conservative" if party==1
replace party_name="Labour" if party==2
replace party_name="Liberal Democrat" if party==3
replace party_name="Brexit Party" if party==4
replace party_name="Green" if party==5
replace party_name="Scottish National Party" if party==6
replace party_name="Plaid Cymru" if party==7

drop party

gen winner=1 if first_party=="Lab"&party_name=="Labour"|first_party=="Con"&party_name=="Conservative"| ///
	first_party=="SNP"&party_name=="Scottish National Party"|first_party=="PC"&party_name=="Plaid Cymru"| ///
	first_party=="Green"&party_name=="Green"|first_party=="LD"&party_name=="Liberal Democrat"

drop if votes==0

replace winner=0 if winner==.

gen share=votes/valid_votes

gen winnershare=share if winner==1
saveold "Britain_constituency_data_2017.dta", replace

**generate dataset with winner's share for each constituency
collapse winnershare, by(constituency_name)
saveold "winner_share_2017.dta", replace
** open original dataset
use "Britain_constituency_data_2017.dta", clear
drop winnershare
** merge in winner's vote shares
merge m:1 constituency_name using "winner_share_2017.dta"
** generate measure of distance
gen distance=winnershare-share
replace distance=0 if winner==1
drop _merge

rename share share2017

drop first_party votes valid_votes winner winnershare

saveold "Britain_constituency_data_2017_for_merge.dta", replace

********************************************************************************************************************

** Recode 2019 results - constituency level for candidate characteristics and BESIP for individual-level

cd "C:\Users\a15014rs\Dropbox\Sexism and Candidates\Data\"

import delimited "HoC-GE2019-results-by-candidate-csv.csv", clear

/** drop Northern Ireland (102 candidates) **/
drop if country=="Northern Ireland"
/** drop variables not required **/
drop sourcelinks ons_id ons_region_id county_name region_name country_name party_abbreviation firstname surname 

** keep main parties
keep if party_name=="Conservative"|party_name=="Labour"|party_name=="Labour and Cooperative"| ///
	party_name=="Liberal Democrat"|party_name=="Scottish National Party"|party_name=="Plaid Cymru"| ///
	party_name=="Green"
	
** descriptives: female candidates
tab gender
replace party_name="Labour" if party_name=="Labour and Co-operative"
tab party_name gender, row
tab sitting_mp gender, row

bysort constituency_name: egen most_votes = max(votes)
gen winner = 1 if votes==most_votes
replace winner = 0 if votes<most_votes
label define winnerlab 0 "lost" 1 "won"
label values winner winnerlab

tab winner gender, row


/*sort observations by constituency*/
sort constituency_name

*saveold "Britain_constituency_data.dta", replace

/* measure of distance from winner in the previous election - 2017 */
drop if party_name=="Independent"
merge 1:1 constituency_name party_name using "Britain_constituency_data_2017_for_merge"

** give median distance if a candidate from that party did not stand in 2018 (excluding winners)
** This also applies to the Speaker's seat
codebook distance
tabstat distance if winner!=1, stats(median)
replace distance = 0.4805175 if distance==.

** share to zero if did not stand in 2017
replace share2017=0 if share2017==.

/** drop if party ran in 2017 but not in 2019 in that constituency**/
drop if _merge==2
drop _merge

** Table 4 - gender of candidate distance from winner
bysort gender: tabstat distance, stats(mean)


** Sample of women only and men only races
encode gender, gen(gender_candidate)
drop if gender_candidate==3
fre gender_candidate
egen women_race = min(gender_candidate), by(constituency_name)
egen women_only = max(gender_candidate), by(constituency_name)
codebook constituency_name
codebook constituency_name if women_race==2
codebook constituency_name if women_only==1
drop gender

tab gender_candidate

saveold "Britain_constituency_data.dta", replace

use "BES2019_W19_v1.0-2.dta", clear

** generate string variable for constituency name
decode pcon, gen(constituency_name)
** name names consistent between the two datasets
replace constituency_name="Ashton-Under-Lyne" if constituency_name=="Ashton-under-Lyne"
replace constituency_name="Berwick-Upon-Tweed" if constituency_name=="Berwick-upon-Tweed"
replace constituency_name="Cities Of London and Westminster" if constituency_name=="Cities of London and Westminster"
replace constituency_name="City Of Chester" if constituency_name=="City of Chester"
replace constituency_name="City Of Durham" if constituency_name=="City of Durham"
replace constituency_name="Forest Of Dean" if constituency_name=="Forest of Dean"
replace constituency_name="Isle Of Wight" if constituency_name=="Isle of Wight"
replace constituency_name="Na h-Eileanan An Iar" if constituency_name=="Na h-Eileanan an Iar"
replace constituency_name="Newcastle Upon Tyne Central" if constituency_name=="Newcastle upon Tyne Central"
replace constituency_name="Newcastle Upon Tyne East" if constituency_name=="Newcastle upon Tyne East"
replace constituency_name="Newcastle Upon Tyne North" if constituency_name=="Newcastle upon Tyne North"
replace constituency_name="Newcastle-Under-Lyme" if constituency_name=="Newcastle-under-Lyme"
replace constituency_name="Stoke-On-Trent Central" if constituency_name=="Stoke-on-Trent Central"
replace constituency_name="Stoke-On-Trent North" if constituency_name=="Stoke-on-Trent North"
replace constituency_name="Stoke-On-Trent South" if constituency_name=="Stoke-on-Trent South"
replace constituency_name="Stratford-On-Avon" if constituency_name=="Stratford-on-Avon"
replace constituency_name="Vale Of Clwyd" if constituency_name=="Vale of Clwyd"
replace constituency_name="Vale Of Glamorgan" if constituency_name=="Vale of Glamorgan"

** variable gender appears in both datasets - rename in BES
rename gender gender_bes

** sort by constituency
sort constituency_name 

** merge candidate data and BESIP
joinby constituency_name using "Britain_constituency_data.dta"

** destring constituency name with names as value labels
encode constituency_name, generate(pcons)

** destring key variables from constituency data
tab sitting_mp
encode sitting_mp, gen(incumbent)
codebook incumbent
drop sitting_mp

** Create variable identifying which candidate a respondent voted for
gen vote_choice = 1 if generalElectionVote==1&party_name=="Conservative"
replace vote_choice = 1 if generalElectionVote==2&party_name=="Labour"| ///
	generalElectionVote==2&party_name=="Labour and Cooperative"| ///
	generalElectionVote==3&party_name=="Liberal Democrat"| ///
	generalElectionVote==4&party_name=="Scottish National Party"| ///
	generalElectionVote==5&party_name=="Plaid Cymru"| ///
	generalElectionVote==7&party_name=="Green"
replace vote_choice=0 if vote_choice==.
replace vote_choice=. if generalElectionVote==9999|genElecTurnoutRetro==0|genElecTurnoutRetro==9999

saveold "Britain_data.dta", replace

**************************************************************************************************************************

** Analysis

cd "C:\Users\a15014rs\Dropbox\Sexism and Candidates\"

use "Data\Britain_data.dta", clear

* Create variable for women races
gen sample_races=1 if women_race==1&women_only==2
**male-female races
replace sample_races=0 if sample_races==.
codebook constituency_name if sample_races==1
**all-women races
codebook constituency_name if women_race==2
**all-male races
codebook constituency_name if women_only==1

** drop if not in a parliamentary constituency
drop if pcon==0

** Sexism measures
gen appreciate = hostileSexism1
gen control = hostileSexism2
gen innocent = hostileSexism3
gen cherished = benevolentSexism1
gen purity = benevolentSexism2
gen pedestal = benevolentSexism3

codebook id if hostileSexism1!=.

* remove the DK 
foreach x in appreciate control innocent cherished purity pedestal {
recode `x' 9999 = .
}

* scale to range - 2 to +2 (positive values = high in sexism)
recode appreciate 1=-2 2=-1 3=0 4=1 5=2
recode control   1=-2 2=-1 3=0 4=1 5=2
recode innocent   1=-2 2=-1 3=0 4=1 5=2
recode cherished   1=-2 2=-1 3=0 4=1 5=2
recode purity   1=-2 2=-1 3=0 4=1 5=2
recode pedestal   1=-2 2=-1 3=0 4=1 5=2

* Create scales
* rowtotal 
egen hostile = rowtotal(innocent control appreciate), missing
egen benevolent = rowtotal(cherished purity pedestal), missing
pwcorr hostile benevolent 

* Recode -1 to +1 
gen hostile_rescale = hostile / 6
gen benevolent_rescale = benevolent/ 6

gen hostile_rescale2 = hostile_rescale+1
gen benevolent_rescale2 = benevolent_rescale+1

gen nothostile=1 if hostile_rescale<0
replace nothostile=0 if hostile_rescale>=0
gen hostile2=1 if hostile_rescale>0
replace hostile2=0 if hostile_rescale<=0

** respondents missing on sexism items
codebook id if hostile_rescale2!=.

** Non-party identifiers
gen nonpartisan=1 if partyId==10
replace nonpartisan=0 if partyId!=10&partyId!=9999

** Party
gen party_candidate=1 if party_name=="Conservative"
replace party_candidate=2 if party_name=="Labour"
replace party_candidate=3 if party_name=="Liberal Democrat"
replace party_candidate=4 if party_name=="Green"
replace party_candidate=5 if party_name=="Scottish National Party"
replace party_candidate=6 if party_name=="Plaid Cymru"
label define partylab 1 "Conservative" 2 "Labour" 3 "Liberal Democrat" 4 "Green" 5 "SNP" 6 "Plaid Cymru"
label values party_candidate partylab

** respondent gender
gen female=1 if gender_bes==2
replace female=0 if gender_bes==1
label define femlab 0 "men" 1 "women"
label values female femlab

** recode candidate gender
gen gender_candidate2=1 if gender_candidate==1
replace gender_candidate2=0 if gender_candidate==2
drop if gender_candidate==3
tab gender_candidate gender_candidate2
drop gender_candidate
rename gender_candidate2 gender_candidate
label define genderlab 0 "male candidate" 1 "female candidate"
label values gender_candidate genderlab

save "Data\Britain_data_recoded.dta", replace

** define sample
gen fullsample=1 if vote_choice!=.&gender_candidate!=.&party_candidate!=.&incumbent!=.&distance!=.&hostile_rescale!=.&generalElectionVote!=.&sample_races==1
replace fullsample=0 if fullsample!=1

** identify respondents with all zeros on vote choice dependent var
clogit vote_choice i.gender_candidate if fullsample==1&sample_races==1 [pw=wt], group(id) or
gen wanted=e(sample)
tab wanted

** Keep analytical sample
keep if wanted==1

** sample size
codebook id


** Scale reliability for the analytical sample
alpha innocent control appreciate

** graph scheme
set scheme cleanplots

** Main Models
* Voting for female candidates - with and without controls
quietly clogit vote_choice i.gender_candidate if fullsample==1&sample_races==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 6 Britain.doc", replace se or starlevels(10 5 1)
margins, dydx(gender_candidate) post
est store model_1
clogit vote_choice i.gender_candidate i.party_candidate i.incumbent c.distance ///
	if fullsample==1&sample_races==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 6 Britain.doc", merge se or starlevels(10 5 1)
margins, dydx(gender_candidate) post
est store model_2
coefplot (model_1, label("M1 - Without controls")) (model_2, label("M2 - With controls")), title("Britain") ///
	ytitle("AME voting for female candidate") ylabel("") xline(0) saving("Output\BJPS resubmission\Britain_table6", replace)


* Voting for female candidates by hostile sexism (controlling for sexism*party)
set more off
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate i.incumbent c.distance ///
	if fullsample==1&sample_races==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 7 Britain.doc", replace se or ctitles("", " c. gender*sexism") starlevels(10 5 1)
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate##c.hostile_rescale2 i.incumbent c.distance ///
	if fullsample==1&sample_races==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 7 Britain.doc", merge se or ctitles("", " c. gender*sexism") starlevels(10 5 1)


** Robustness checks
* for men and women
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate##c.hostile_rescale2 i.incumbent c.distance ///
	if fullsample==1&female==1&sample_races==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Robustness checks\gender Britain.doc", replace se or ctitles("", "women") starlevels(10 5 1)
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate##c.hostile_rescale2 i.incumbent c.distance ///
	if fullsample==1&female==0&sample_races==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Robustness checks\gender Britain.doc", merge se or ctitles("", "men") starlevels(10 5 1)

* for partisans and non partisans
gen partisan = 1
replace partisan = 0 if partyId == 10 
replace partisan = . if partyId == 9999

clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate##c.hostile_rescale2 i.incumbent c.distance ///
	if fullsample==1&sample_races==1&partisan==0 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Robustness checks\partisanship Britain.doc", replace se or ctitles("", " c. non-partisan") starlevels(10 5 1)
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate##c.hostile_rescale2 i.incumbent c.distance ///
	if fullsample==1&sample_races==1&partisan==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Robustness checks\partisanship Britain.doc", merge se or ctitles("", " c. partisan") starlevels(10 5 1)

* By party 
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate##c.hostile_rescale2 i.incumbent c.distance ///
	if fullsample==1&sample_races==1&partyId==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Robustness checks\party Britain.doc", replace se or ctitles("", " c. Conservative identifiers") starlevels(10 5 1)
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate##c.hostile_rescale2 i.incumbent c.distance ///
	if fullsample==1&sample_races==1&partyId==2 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Robustness checks\party Britain.doc", merge se or ctitles("", " c. Labour identifiers") starlevels(10 5 1)

* Using "women seek to gain power by getting control over men" (consistent across countries)
clogit vote_choice i.gender_candidate##c.control i.party_candidate##c.control i.incumbent c.distance ///
	if fullsample==1&sample_races==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Robustness checks\control item Britain.doc", replace se or starlevels(10 5 1)

* Benevolent sexism
clogit vote_choice i.gender_candidate##c.benevolent_rescale2 i.party_candidate##c.benevolent_rescale2 i.incumbent c.distance ///
	if fullsample==1&sample_races==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Robustness checks\benevolent Britain.doc", replace se or starlevels(10 5 1)


* Vote share at previous election as a control
* correlation between vote share at previous election and distance from the winning party = -0.9246
clogit vote_choice i.gender_candidate i.party_candidate i.incumbent c.share2017 ///
	if fullsample==1&sample_races==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Robustness checks\vote share control Britain.doc", replace se or starlevels(10 5 1)
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate i.incumbent c.share2017 ///
	if fullsample==1&sample_races==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Robustness checks\vote share control Britain.doc", merge se or starlevels(10 5 1)
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate##c.hostile_rescale2 i.incumbent c.share2017 ///
	if fullsample==1&sample_races==1 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Robustness checks\vote share control Britain.doc", merge se or starlevels(10 5 1)

** Revision #2 - Scotland only
set more off
clogit vote_choice i.gender_candidate ///
	if fullsample==1&sample_races==1&gor==11 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 7 Scotland.doc", replace se or starlevels(10 5 1)
clogit vote_choice i.gender_candidate i.party_candidate i.incumbent c.distance ///
	if fullsample==1&sample_races==1&gor==11 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 7 Scotland.doc", merge se or starlevels(10 5 1)
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate i.incumbent c.distance ///
	if fullsample==1&sample_races==1&gor==11 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 7 Scotland.doc", merge se or starlevels(10 5 1)
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate##c.hostile_rescale2 i.incumbent c.distance ///
	if fullsample==1&sample_races==1&gor==11 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 7 Scotland.doc", merge se or starlevels(10 5 1)

** Wales only
set more off
clogit vote_choice i.gender_candidate ///
	if fullsample==1&sample_races==1&gor==10 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 7 Wales.doc", replace se or starlevels(10 5 1)
clogit vote_choice i.gender_candidate i.party_candidate i.incumbent c.distance ///
	if fullsample==1&sample_races==1&gor==10 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 7 Wales.doc", merge se or starlevels(10 5 1)
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate i.incumbent c.distance ///
	if fullsample==1&sample_races==1&gor==10 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 7 Wales.doc", merge se or starlevels(10 5 1)
clogit vote_choice i.gender_candidate##c.hostile_rescale2 i.party_candidate##c.hostile_rescale2 i.incumbent c.distance ///
	if fullsample==1&sample_races==1&gor==10 [pw=wt], group(id) or
outreg using "Output\BJPS resubmission\Table 7 Wales.doc", merge se or starlevels(10 5 1)

** Table 3 for analytical samople only
collapse hostile2 nothostile [iw=wt], by(id)

tab nothostile
tab hostile2

** Abstention models
use "Data\Britain_data_recoded.dta", clear 

** 80% turnout in the weighted sample
** Abstainers
gen abstain=1 if genElecTurnoutRetro==0
replace abstain=0 if genElecTurnoutRetro==1

** Individual-level covariates
gen educ=1 if p_education>=1&p_education<=8
replace educ=2 if p_education>=9&p_education<=10
replace educ=3 if p_education>=11&p_education<=12
replace educ=4 if p_education>=15&p_education<=17
replace educ=5 if p_education>=13&p_education<=14|p_education==18

label define educlab 1 "Below GCSE" 2 "GCSE or equivalent" 3 "A-Level or equivalent" ///
	4 "University" 5 "Other"
label values educ educlab

* employment status
gen employment = . 
replace employment = 1 if workingStatus == 1 | workingStatus == 2 | workingStatus == 3
replace employment = 0 if workingStatus == 4 | workingStatus == 8
replace employment = 2 if workingStatus == 5 | workingStatus == 6
replace employment = 3 if workingStatus == 7
label define employment_label_new 0 "Unemployed" 1 "Employed" 2 "Student" 3 "Retired"
label values employment employment_label_new 

* socio-economic status
recode p_socgrade 8 = . 

* union membership
gen union = currentUnionMember
recode union 9999=. 

* district competitiveness - distance
* gender - female 

* region dummy - gor

** Co-partisan
gen copartisan=1 if party_candidate==1&partyId==1|party_candidate==2&partyId==2| ///
	party_candidate==3&partyId==3|party_candidate==4&partyId==7|party_candidate==5&partyId==12| ///
	party_candidate==6&partyId==4|party_candidate==7&partyId==5
replace copartisan=0 if copartisan==.
drop if copartisan==0
** restricting models to these respondents also reduces the number of observations per respondent to 1

codebook id if hostile_rescale2!=.&copartisan==1
codebook id if hostile_rescale2!=.

** Turnout model
logit abstain c.hostile_rescale2##i.gender_candidate i.female i.educ c.age i.employment i.p_socgrade  c.distance i.incumbent ///
	i.union i.gor [pw=wt] if sample_races==1
outreg using "Output\BJPS resubmission\Table 8 Britain.doc", replace se or ctitles("", "Abstention") starlevels (10 5 1)
margins gender_candidate, at(hostile_rescale2=(0(1)2))
marginsplot, ytitle("Probability of abstaining") xtitle("") xlabel(0 "Not sexist (<1)" 1 "Neutral (1)" 2 "Sexist (>1)") ///
	title("Britain") saving("Output\BJPS resubmission\Britain_table8", replace)

** Robustness - by party
logit abstain c.hostile_rescale2##i.gender_candidate i.female i.educ c.age i.employment i.p_socgrade  c.distance i.incumbent ///
	i.union i.gor [pw=wt] if sample_races==1&partyId==1
outreg using "Output\BJPS resubmission\Robustness checks\party turnout Britain.doc", replace se or ctitles("", "Conservative identifiers") starlevels (10 5 1)
logit abstain c.hostile_rescale2##i.gender_candidate i.female i.educ c.age i.employment i.p_socgrade  c.distance i.incumbent ///
	i.union i.gor [pw=wt] if sample_races==1&partyId==2
outreg using "Output\BJPS resubmission\Robustness checks\party turnout Britain.doc", merge se or ctitles("", "Labour identifiers") starlevels (10 5 1)

** Robustness - using "women seek to gain power by getting control over men"
logit abstain c.control##i.gender_candidate i.female i.educ c.age i.employment i.p_socgrade  c.distance i.incumbent ///
	i.union i.gor [pw=wt] if sample_races==1
outreg using "Output\BJPS resubmission\Robustness checks\control turnout Britain.doc", replace se or starlevels (10 5 1)
margins gender_candidate, at(control=(-2(1)2))
marginsplot

** Robustness - benevolent sexism
logit abstain c.benevolent_rescale2##i.gender_candidate i.female i.educ c.age i.employment i.p_socgrade  c.distance i.incumbent ///
	i.union i.gor [pw=wt] if sample_races==1
outreg using "Output\BJPS resubmission\Robustness checks\benevolent turnout Britain.doc", replace se or starlevels (10 5 1)
logit abstain c.benevolent_rescale2##i.gender_candidate c.hostile_rescale2##i.gender_candidate i.female i.educ c.age i.employment i.p_socgrade  c.distance i.incumbent ///
	i.union i.gor [pw=wt] if sample_races==1
outreg using "Output\BJPS resubmission\Robustness checks\benevolent turnout Britain.doc", merge se or starlevels (10 5 1)

** Controlling for previous vote share
logit abstain c.hostile_rescale2##i.gender_candidate i.female i.educ c.age i.employment i.p_socgrade  c.distance c.share2017 ///
	i.union i.gor [pw=wt] if sample_races==1 
outreg using "Output\BJPS resubmission\Robustness checks\vote share control turnout Britain.doc", replace se or starlevels (10 5 1)


** Abstainers versus voters on sexism
collapse abstain hostile_rescale [iw=wt], by(id)
drop if hostile_rescale==.

gen nothostile=1 if hostile_rescale<0
replace nothostile=0 if hostile_rescale>=0
gen hostile2=1 if hostile_rescale>0
replace hostile2=0 if hostile_rescale<=0

tab abstain hostile2, row
tab abstain nothostile, row

log close






